home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: news3.noc.netcom.net!zdc!zippo!usenet
- From: Oliver.Schaedlich@launchpad.unc.edu
- Subject: Constructor Exceptions
- Sender: usenet@news.zippo.com
- Nntp-Posting-Host: sunserver1.rz.uni-duesseldorf.de
- Organization: Zippo
- Message-ID: <DKpyu6.315@news.zippo.com>
- Date: Fri, 5 Jan 1996 17:49:18 GMT
-
- Hi!
-
- I've had the same problem with throwing exceptions from a constructor until
- Visual C++ 4.0 (<= 2.2 doesn't free mem.). The documentation on VC++ 4.0
- says that the memory occupied by an new-ed object isn't freed when throwing
- an exception. Because VC++ 4.0 *does* free the memory I think Microsoft
- missed to correct or even delete this part of the documentation.
- Microsoft's new behaviour is correct according to the ANSI C++ draft and
- Watcom 10.5 is also ok. So if you don't have VC++ 4.0 yet use exceptions
- in your constructors and compinal the final code when you have VC++ 4.0.
- There are some compilers which have this bug and others don't. F.e. sun's
- c++ implementation is not ok and the Gnu implementation is ok.
-